<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style> 
    .box {
      position: relative;
      border: 1px solid;
    }
    .item {
      position: absolute;
      left: 100px;
      top: 200px;
      width: 50px;
      height: 50px;
      background: red;
    }
  </style>
</head>
<body>
  <div class="box">
    <div class="item"></div>
    <div class="item"></div>
    <div class="item"></div>
    <div class="item"></div>
    <div class="item"></div>
    <div class="item"></div>
    <div class="item"></div>
    <div class="item"></div>
    <div class="item"></div>
    <div class="item"></div>
    <div class="item"></div>
    <div class="item"></div>

  </div>
  <script src="../libs/jquery-1.12.4.js"></script>
  <script>
    /* 
      距离浏览器窗口的偏移量
        offset得到的是一个对象，该对象中包含了top 和 left两个属性值

      offset可以传入一个参数为对象，对象中有top,left两个属性，这两个属性可以设置对应的距离
    
    */
    $(function () {
      // console.log($('.item').offset())
      // $('.item').offset({top: 10, left: 10})
      $('.item').offset(function (index) {
        return {
          left: index * 50,
          top: index * 50
        }
      })

    })
  </script>
</body>
</html>